<template>
  <div>
    <h3>V-model数据双向绑定</h3>
    <div>
      <Child v-model="count" />
      <!-- 在组件中 自定义事件函数默认接受的参数是$event是子组件的传参 -->
      <Child :value="count" @input="count = $event" />
    </div>
  </div>
</template>

<script>
import Child from "./Child.vue";
export default {
  name: "Vmodel",
  components: { Child },
  data() {
    return {
      count: 0,
    };
  },
};
</script>

<style>
</style>